package com.gzw.dms.utils;


/**
 * Created by gaozhiwei on 2015/11/19.
 */
public class UrlUtils {
    private  final String APK_URL ="APK_URL";
    private  final String SERVICE_URL ="SERVICE_URL";
    private  final String IP="IP";


    public static  UrlUtils getInstance()
    {
        return UrlUtilsHolder.sInstance;
    }
    public static class UrlUtilsHolder{
        private static final UrlUtils sInstance=new UrlUtils();
    }
    //获取WebService地址
    public  String getServiceUrl(String method){
        String url=getIp()+PropertiesUtil.Read(SERVICE_URL);
        if (method!=null){
            url=url +"/"+method;
        }
        return url;
    }
    public String getJavaUrl(String method){
        String url=getIp()+PropertiesUtil.Read(SERVICE_URL);
        if (method!=null){
            url=url +"?method="+method;
        }
        return url;
    }
    //获取apk下载地址
    public String getApkUrl(){
       return getIp()+PropertiesUtil.Read(APK_URL);
    }
    //获取IP地址
    private  String getIp(){
//        return "http://192.168.5.20:8080";
        return "http://139.129.216.151:8088";
//        return "http://139.129.216.151:56788";

//        return PropertiesUtil.Read(IP);
    }
}
